<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<%@ include file="./nav.jsp" %>
<script type="text/javascript">
    function check() {
        var pass = $("#inputPassword").val();
        var pass1 = $("#repeatPassword").val();
        if (pass == pass1){
            return true;
        } else {
            alert("两次输入密码不符！");
            return false;
        }

    }

</script>

<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2" style="margin-top:5%;">
            <div class="row">
                <div class="col-md-6">
                    <img src="/img/wallhaven-751364.jpg" style="height: 400px;width: 100%;">
                </div>
                <div class="col-md-6 login-model">

                    <form class="form-horizontal" style="margin-top: 35%;" id="registerForm"
                    action="${pageContext.request.contextPath}/api/user/register" method="post"
                    onsubmit="return check()">
                        <div class="form-group">
                            <label for="inputname2" class="col-sm-3 control-label">用户名</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" id="inputname2" name="name">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="inputPassword" class="col-sm-3 control-label">密码</label>
                            <div class="col-sm-9">
                                <input type="password" class="form-control" id="inputPassword" name="pass">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="repeatPassword" class="col-sm-3 control-label">重复密码</label>
                            <div class="col-sm-9">
                                <input type="password" class="form-control" id="repeatPassword" name="repeatPass">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-4 col-sm-8">
                                <button type="button" class="btn btn-default">
                                    <a href="${pageContext.request.contextPath}/login.jsp">登录</a>
                                </button>
                                <button type="submit" class="btn btn-info">注册</button>
                            </div>

                        </div>
                    </form>



                </div>
            </div>
        </div>
    </div>
</div>

</body>
</html>
